<?php /* Smarty version 2.6.20, created on 2013-05-25 01:50:40
         compiled from _core/_include/module/_mvc/control/handlecontainercustomer.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'escape', '_core/_include/module/_mvc/control/handlecontainercustomer.tpl', 36, false),)), $this); ?>
function HandleContainerCustomer(gui, item, options) {
  this._gui = gui;
  this._item = item;
  this._options = options;
  
  this._createElements();
}

HandleContainerCustomer.prototype._createElements = function() {
  var _self = this;
  DOMUtils.removeChildElements(this._gui.customerNo);
  DOMUtils.removeChildElements(this._gui.brideName);
  DOMUtils.removeChildElements(this._gui.groomName);
  DOMUtils.removeChildElements(this._gui.bridePhone);
  DOMUtils.removeChildElements(this._gui.groomPhone);
  DOMUtils.removeChildElements(this._gui.brideMobile);
  DOMUtils.removeChildElements(this._gui.groomMobile);
  DOMUtils.removeChildElements(this._gui.date);
  DOMUtils.removeChildElements(this._gui.operator);
  
  this._gui.customerNo.appendChild(document.createTextNode(this._item.id));
  this._gui.brideName.appendChild(document.createTextNode(this._item.bridename));
  this._gui.groomName.appendChild(document.createTextNode(this._item.groomname));
  this._gui.bridePhone.appendChild(document.createTextNode(this._item.bridephone));
  this._gui.groomPhone.appendChild(document.createTextNode(this._item.groomphone));
  this._gui.brideMobile.appendChild(document.createTextNode(this._item.bridemobile));
  this._gui.groomMobile.appendChild(document.createTextNode(this._item.groommobile));
  this._gui.date.appendChild(document.createTextNode(' ' + SimpleDate.format(this._item.createdDate)));
  this._gui.operator.appendChild(document.createTextNode(' ' + ((this._item.userAccount) ? this._item.userAccount : 'None')));
  
  for (var i = 0, il = this._item.orders.length; i < il; i++) {
    var order = this._item.orders[i];
    DOMUtils.removeChildElements(this._gui.orderType[i].type);
    this._gui.orderType[i].type.appendChild(document.createTextNode(order.flag + ' ( ' + ((order.disposalstatus == 1) ? 'cancelled' : SimpleDate.format(order.date)) + ' )'));
  }
  if (this._options.operator.type == '<?php echo ((is_array($_tmp=@USER_TYPE_MANAGER_ASSISTANT)) ? $this->_run_mod_handler('escape', true, $_tmp, 'javascript') : smarty_modifier_escape($_tmp, 'javascript')); ?>
') {
    this._gui.view.onclick =  function() { location.href = '?p=pageasst&t=pagecustomerold&m=' + JSON.stringify({a:2, b:1}) + '&opts=' + JSON.stringify({ id: _self._item.id }); };
  } else if (this._options.operator.type == '<?php echo ((is_array($_tmp=@USER_TYPE_CUSTOMER_SERVICE)) ? $this->_run_mod_handler('escape', true, $_tmp, 'javascript') : smarty_modifier_escape($_tmp, 'javascript')); ?>
') {
    this._gui.view.onclick =  function() { location.href = '?p=pageserv&t=pagecustomerold&m=' + JSON.stringify({a:2, b:1}) + '&opts=' + JSON.stringify({ id: _self._item.id }); };
  } else if (this._options.operator.type == '<?php echo ((is_array($_tmp=@USER_TYPE_ADMIN)) ? $this->_run_mod_handler('escape', true, $_tmp, 'javascript') : smarty_modifier_escape($_tmp, 'javascript')); ?>
') {
    this._gui.view.onclick =  function() { location.href = '?p=pageadmin&t=pagecustomerold&m=' + JSON.stringify({a:2, b:1}) + '&opts=' + JSON.stringify({ id: _self._item.id }); };
  } else {
    this._gui.view.onclick =  function() { location.href = '?p=pagemanager&t=pagecustomerold&m=' + JSON.stringify({a:2, b:1}) + '&opts=' + JSON.stringify({ id: _self._item.id }); };
  }
};